package org.ourpioneer.excel.excute;

import java.util.List;

import org.ourpioneer.excel.excute.entity.FromEntity;
import org.ourpioneer.excel.excute.process.ProcessFile;
import org.ourpioneer.excel.excute.process.ReadFile;
import org.ourpioneer.excel.excute.process.WriteFile;

public class Start {
	
	private static String xls2003 = "C:\\test\\2006.xls";
	private static String xls2003Out = "C:\\test\\Out-2006.xls";

	/**
	 * 主函数
	 * 
	 * @param args
	 */
	public static void main(String[] args) {
		long start = System.currentTimeMillis();
		
		long startR = System.currentTimeMillis();
		ReadFile readFile = new ReadFile();
		List<FromEntity>fFromEntitylist = readFile.readFromXLS2003(xls2003);
		int i = 1;
		for (FromEntity fromEntity : fFromEntitylist) {
			System.out.println(i + ":" + fromEntity);
			i++;
		}
		long endR = System.currentTimeMillis();
		System.out.println((endR - startR) + " ms Read done!");
		
		long startP = System.currentTimeMillis();
		ProcessFile processFile = new ProcessFile();
		List<Object> allInfo= processFile.extract(fFromEntitylist);
		long endP = System.currentTimeMillis();
		System.out.println((endP - startP) + " ms Read done!");
		
		long startW = System.currentTimeMillis();
		WriteFile writeFile = new WriteFile();
		writeFile.generateExcel2003(xls2003Out, allInfo);
		long endW = System.currentTimeMillis();
		System.out.println((endW - startW) + " ms Write done!");
		
		long end = System.currentTimeMillis();
		System.out.println((end - start) + " ms All done!");
	}
}
